import config from "@/config"
import http from "@/utils/request"

export default {
	userInfo: {
		url: `${config.MOCK_URL}/userInfo`,
		name: "获取当前用户信息",
		get: async function(){
			return await http.get(this.url)
		}
	},
	userAdd: {
		url: `${config.API_URL2}/api/user/userAdd`,
		name: "新增用户信息",
		post: async function(data) {
			return await http.post(this.url, data)
		}
	},
	list: {
		url: `${config.API_URL2}/api/user/userIndex`,
		name: "用户信息",
		get: async function(data) {
			return await http.get(this.url, data)
		}
	},
	delUser: {
		url: `${config.API_URL2}/api/user/userDel`,
		name: "删除用户信息",
		delete: async function(id) {
			let deleteUrl = `${this.url}/${id}`;
			return await http.delete(deleteUrl)
		}
	}
}